package com.xinqi.modules.exam.student.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.repo.SuperMapper;
import com.xinqi.modules.exam.paper.dto.rsp.CourseExamPaperStatsDataDTO;
import com.xinqi.modules.exam.student.domain.CourseExamPaperStudentEntity;
import com.xinqi.modules.exam.student.dto.req.CourseExamPaperStudentQueryDTO;
import com.xinqi.modules.exam.student.dto.rsp.CourseExamPaperStudentListDTO;
import com.xinqi.modules.exam.student.dto.rsp.CourseExamPaperStudentResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 课程测评学生答题数据层
 *
 * @author: linkai
 * @date: 2023/07/02
 */
@Mapper
public interface CourseExamPaperStudentMapper extends SuperMapper<CourseExamPaperStudentEntity> {
    Page<CourseExamPaperStudentResultDTO> findPage(Page<Object> page, @Param("dto") CourseExamPaperStudentQueryDTO query);

    List<CourseExamPaperStudentResultDTO> findList(@Param("dto") CourseExamPaperStudentQueryDTO query);

    int updateRejectPaper(@Param("status") String status, @Param("examId") Long examId, @Param("studentIdList") List<Long> studentIdList);

    int updateRejectPaperByIds(@Param("status") String status, @Param("studentPaperIdList") List<Long> studentPaperIdList);

    List<CourseExamPaperStudentListDTO> findStudentList(@Param("dto") CourseExamPaperStudentQueryDTO dto);

    IPage<CourseExamPaperStudentListDTO> pageStudentList(Page<Object> page, @Param("dto") CourseExamPaperStudentQueryDTO dto);

    CourseExamPaperStudentEntity findRandStudent(@Param("examId") Long examId);

    CourseExamPaperStatsDataDTO findStats01(@Param("examId") Long examId);

    int updateNotCommitPaperStatus(@Param("examId") Long examId);

}
